package util;

import java.util.Map;

import org.apache.commons.mail.SimpleEmail;

/**
 *邮件发送工具类
 */
public class EmailUtil {
	public static void sendSimpleEmail(Map<String, String> param) throws Exception{
		SimpleEmail email = new SimpleEmail();
	    email.setHostName("smtp.126.com");
	    email.setAuthentication("frankingly@126.com", "babamama521");//邮件服务器验证：用户名/密码
	    email.setCharset("UTF-8");//必须放在前面，否则乱码
	    email.addTo(param.get("to"));
	    email.setFrom("frankingly@126.com", "frankingly");
	    email.setSubject("邮箱验证码");
	    email.setMsg("邮箱验证码" + param.get("email_verify_code"));
	    email.send();
	}
	
	
	
//	public static void main(String[] args) throws Exception {
//		sendSimpleEmail();
//	}
}
